package com.woniuxy.mytank.effect;

import java.awt.Graphics;

import javax.swing.JPanel;

import com.woniuxy.mytank.datacenter.DataCenter;
import com.woniuxy.mytank.util.ReadImage;

public class MegaBomb implements Runnable{
	
	public int step;
	
	public MegaBomb(){
		new Thread(this).start();
	}
	
	public void drawMegaBomb(Graphics g, JPanel p){
		g.drawImage(ReadImage.MegaBomb2[step], 244, 198, 571, 618, 0, 0, 109, 140, p);
		
		
	}

	@Override
	public void run() {
		while(true){
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			step++;
			if(step>15){
				break;
			}
		}
		DataCenter.mb.remove(this);
	}

}
